import requests from '../config/request.js'



// export const addCart = (payload) => {
//     return requests.httpTokenRequest({
//         url: "/Cart/AddCart",
//         data:payload
//     });
// };

// export const getCartNum = (payload) => {
//     return requests.httpTokenRequest({
//         url: "/Cart/GetCartNum",
//         data:payload
//     });
// };


// export const getCartInfo = (payload) => {
//     return requests.httpTokenRequest({
//         url: "/Cart/GetCartInfo",
//         data:payload
//     });
// };

// export const clearCart = (payload) => {
//     return requests.httpTokenRequest({
//         url: "/Cart/ClearCart",
//         data:payload
//     });
// };

// export const deleteCart = (payload) => {
//     return requests.httpTokenRequest({
//         url: "/Cart/DeleteCart",
//         data:payload
//     });
// };

export const getdefaultAddress = (payload) => {
    return requests.httpTokenRequest({
        url: "/Cart/GetdefaultAddress",
        data:payload
    });
};

// export const submitOrder = (payload) => {
//     return requests.httpTokenRequestSpecial({
//         url: "/Cart/SubmitOrder",
//         data:payload
//     });
// };

// ******************************

// 加入购物车
export const addCart = (payload) => {
    return requests.requestAll("/client/cart/addCart",'post',payload);
};
// 列表
export const getCartInfo = (payload) => {
    return requests.requestAll("/client/cart/queryCart?storeId=0",'post',payload,false);
};

// 购物车数量
export const getCartNum = (payload) => {
    return requests.requestAll("/client/cart/queryCart?storeId=0",'post',payload,false);
};
// 清空
export const clearCart = (payload) => {
    return requests.requestAll("/client/cart/clearCart",'post',payload,false);
};
// 删除
export const deleteCart = (payload) => {
    return requests.requestAll("/client/cart/remove",'post',payload);
};

export const submitOrder = (payload) => {
  return requests.requestAll("/client/mallProduct/submitMallProduct",'post',payload,false);
};
